home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(_root.paus3)
- {
- speed = 0;
- maxspeed = 0;
- }
- if(!_root.paus3)
- {
- if(this.hitTest(_root.camera))
- {
- speed = 0;
- maxspeed = 10;
- damage = 0;
- grav++;
- _Y = _Y + grav;
- while(_root.ground.hitTest(_X,_Y,true))
- {
- _Y--;
- grav = 0;
- }
- if(_root.ground.hitTest(_X + _width / 2 + ex,_Y - _height / 2,true) || _root.ground.hitTest(_X + _width / 2 + ex,_Y - _height / 6,true) || _root.ground.hitTest(_X + _width / 2 + ex,_Y - _height,true))
- {
- _X = _X - speed;
- }
- if(_root.ground.hitTest(_X - _width / 2 - ex,_Y - _height / 2,true) || _root.ground.hitTest(_X - _width / 2 - ex,_Y - _height / 6,true) || _root.ground.hitTest(_X - _width / 2 - ex,_Y - _height,true))
- {
- _X = _X + speed;
- }
- if(this.hitTest(_root.camera.righthit))
- {
- if(_global.sounds == 1)
- {
- eagle = new Sound(this);
- eagle.attachSound("eagle");
- eagle.start(0,1);
- }
- }
- moving = 0;
- above = 0;
- if(this._x < _root.char._x && !attack && !above && !this.hitTest(_root.char) && this._currentframe != 5 && this._currentframe != 25 && this._currentframe != 10 && this.hitTest(_root.camera) && _root.char._currentframe != 45)
- {
- this._x += movespeed;
- _xscale = scale;
- attack = 0;
- moving = 1;
- }
- else if(this._x > _root.char._x && !attack && !above && !this.hitTest(_root.char) && this._currentframe != 5 && this.hitTest(_root.camera) && _root.char._currentframe != 45 && this._currentframe != 35 && this._currentframe != 10)
- {
- this._x -= movespeed;
- _xscale = - scale;
- attack = 0;
- moving = 1;
- }
- if(_root.char._currentframe == 45)
- {
- this.gotoAndStop("idle");
- moving = 0;
- }
- if(!moving && this._currentframe != 5)
- {
- moving = 0;
- }
- if(this._currentframe == 35)
- {
- this._x += movespeed;
- }
- }
- }
- }
-